import jsonschema

js_schema = {
    "type": "object",
    "properties": {
        "success": {
            "type": "boolean"
        },
        "code": {
            "type": "integer"
        },
        "message": {
            "type": "string"
        }
    },
    "required": ["success", "code", "message"]

}

var = {
    "success": True,
    "code": 10000,
    "message": "操作成功"
}

res = jsonschema.validate(schema=js_schema, instance=var)
print("校验结果==", res)